Add CancelAScheduledRetry endpoint and related classes #484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to handle the cancellation of scheduled retries for payments in the
CheckoutSdk. The changes include adding a new API method, creating corresponding request and response models, and implementing unit and integration tests for this functionality.New Feature: Cancel a Scheduled Retry
API Implementation:
CancelAScheduledRetry, to theIPaymentsClientinterface and its implementation inPaymentsClient. This method validates parameters and sends a POST request to thecancellationsendpoint to cancel a scheduled retry. (src/CheckoutSdk/Payments/IPaymentsClient.cs- [1]src/CheckoutSdk/Payments/PaymentsClient.cs- [2]CancelAScheduledRetryPathinPaymentsClientto define the new endpoint path. (src/CheckoutSdk/Payments/PaymentsClient.cs- src/CheckoutSdk/Payments/PaymentsClient.csR11)Request and Response Models:
CancelAScheduledRetryRequestclass to encapsulate the request payload, including aReferenceproperty. (src/CheckoutSdk/Payments/Request/CancelAScheduledRetryRequest.cs- src/CheckoutSdk/Payments/Request/CancelAScheduledRetryRequest.csR1-R7)CancelAScheduledRetryResponseclass to handle the API response, including properties forActionIdandReference. (src/CheckoutSdk/Payments/Response/CancelAScheduledRetryResponse.cs- src/CheckoutSdk/Payments/Response/CancelAScheduledRetryResponse.csR1-R11)Testing:
ShouldCancelAScheduledRetry, to validate the behavior of theCancelAScheduledRetrymethod inPaymentsClientTest. (test/CheckoutSdkTest/Payments/PaymentsClientTest.cs- test/CheckoutSdkTest/Payments/PaymentsClientTest.csR265-R287)ShouldCancelAScheduleRetry, to verify the end-to-end functionality of the new feature. This test is marked with[Fact(Skip = "Use on demand")]for conditional execution. (test/CheckoutSdkTest/Payments/RequestPaymentsIntegrationTest.cs- test/CheckoutSdkTest/Payments/RequestPaymentsIntegrationTest.csR252-R268)